package com.yazi.mxz.behavior.jackson.filter;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.yazi.mxz.behavior.entity.repository.Category;

public abstract class CategoryFilter {

	public static FilterProvider get() {
		
		final Set<String> category = new HashSet<String>();
		category.add("catId");
		category.add("parentId");
		category.add("type");
		category.add("name");
		category.add("deep");
		category.add("pic");
		
		return new SimpleFilterProvider()
				.addFilter(Category.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(category));
	}
	
	public static FilterProvider getWithCategories() {
		
		final Set<String> category = new HashSet<String>();
		category.add("catId");
		category.add("parentId");
		category.add("type");
		category.add("name");
		category.add("deep");
		category.add("pic");
		category.add("categories");
		
		return new SimpleFilterProvider()
				.addFilter(Category.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(category));
	}

}
